
CREATE TABLE [dbo].[DatabaseFile](
	[DatabaseFileID] [int] IDENTITY(500000,1) NOT NULL,
	[DatabaseID] [int] NOT NULL,
	[FileName] [varchar](128) NOT NULL,
	[FilePath] [varchar](256) NOT NULL,
	[FileSize] [int] NOT NULL,
	[UsedSpace] [int] NULL,
	[FileGrowth] [int] NULL,
	[FileGrowthType] [char](10) NULL,
	[FileMaxSize] [bigint] NULL,
	[CreateDate] [datetime] NOT NULL,
	[UpdateDate] [datetime] NOT NULL,
	[Active] [tinyint] NOT NULL,
 CONSTRAINT [PK_DatabaseFile] PRIMARY KEY NONCLUSTERED 
(
	[DatabaseFileID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'File path including file name.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseFile', @level2type=N'COLUMN',@level2name=N'FilePath'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The current size of the dat file in KB.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseFile', @level2type=N'COLUMN',@level2name=N'FileSize'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The amount of used space in the data file in KB.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseFile', @level2type=N'COLUMN',@level2name=N'UsedSpace'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The growth increment for the data file in KB or percent.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseFile', @level2type=N'COLUMN',@level2name=N'FileGrowth'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The growth type for the data file in kilobytes or percent.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseFile', @level2type=N'COLUMN',@level2name=N'FileGrowthType'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The maximum size to which the data file can grow in KB.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseFile', @level2type=N'COLUMN',@level2name=N'FileMaxSize'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The DatabaseFile table contains information about the drives on each MS SQL server.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DatabaseFile'
GO

ALTER TABLE [dbo].[DatabaseFile] ADD  CONSTRAINT [DF_DatabaseFile_Active]  DEFAULT ((0)) FOR [Active]
GO


